import requests,json

page = 1

max_page = 5
top_num = 1

while page <= max_page:
    songLink = 'https://c.y.qq.com/soso/fcgi-bin/client_search_cp?ct=24&qqmusic_ver=1298&new_json=1&remoteplace=sizer.yqq.song_next&searchid=56594058263751035&t=0&aggr=1&cr=1&catZhida=1&lossless=0&flag_qc=0&p='+str(page)+'&n=20&w=%E5%91%A8%E6%9D%B0%E4%BC%A6&g_tk=1559230897&loginUin=1099113511&hostUin=0&format=json&inCharset=utf8&outCharset=utf-8&notice=0&platform=yqq.json&needNewCode=0'
    song_data = requests.get(songLink)
    json_song_data = json.loads(song_data.text)
    song_dist = json_song_data['data']['song']['list']
    for i in song_dist:
        print("序号："+str(top_num)+' 歌名：'+i['name']+' 所属专辑：'+i['album']['name']+' 时长：'+str(i['interval'])+' 播放链接：https://y.qq.com/n/yqq/song/'+i['file']['media_mid']+'html\n')
        top_num += 1
    page += 1








